package com.qf.controller;

import com.qf.pojo.resp.BaseResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@Api("错误控制器")
@ControllerAdvice
@ResponseBody
public class ExceptionController {
    @ExceptionHandler(AuthorizationException.class)
    @ApiOperation(value = "错误控制的方法")
    public BaseResp authorizationException(){
        return new BaseResp().UnAuthor();
    }
}
